package cool.mor.dao;

import cool.mor.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * @author Ivan
 */
@Repository
public interface UserRepository extends JpaRepository<User,String> {
    /**
     *   根据手机号码（登录账号）查询用户
     * @param phoneNumber
     * @return
     */
    public User findByPhoneNumber(String phoneNumber);

    /**
     * 根据传入的电话号码判断是否有这个对象，有则返回true，无则false
     * @param phoneNumber
     * @return
     */
    public boolean existsByPhoneNumber(String phoneNumber);
}
